<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	
	<link rel="stylesheet" type="text/css" href="../../css/base.css" />
	<link id="easyuiTheme"  rel="stylesheet" type="text/css" href="../../easy-ui/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="../../easy-ui/themes/icon.css">
	<script type="text/javascript" src="../../easy-ui/jquery.min.js"></script>
	<script type="text/javascript" src="../../easy-ui/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="../../js/base.js" ></script>
	<script type="text/javascript" src="../../js/ajaxfileupload.js" ></script>
</head>


<body class="easyui-layout" data-options="fit:true" style="overflow:hidden;">
	
		
	
		<!-- 表单提交-->
								<div data-options="region:'south',border:false," style="height:40px;text-align:center;">
		
									  <table style="width:100%;margin-top:8px;" >
													<tr>
													<td style="align:center;">
														<a href='javascript:void(-1);' onclick="baseFormSubmit();"; class="easyui-linkbutton" data-options="iconCls:'icon-save'">确定</a>&nbsp;&nbsp;
														<a href='javascript:void(-1);' onclick="baseFormReset();";  class="easyui-linkbutton" data-options="iconCls:'icon-back'">重置</a>
													</td>
													</tr>
										</table>
								</div>
	

		
		<div data-options="region:'center',border:true,">
		
		<!-- the baseForm start  -->
		<form id="baseForm" name="baseForm" method="post" target="hiddenFrame" style="margin:0px;padding:0px;overflow:hidden;">
		
		<input id="id" name="id" type="hidden" /> 	
		<input  name="payType"    id="payType" type="hidden" ></input>
		<input  name="status"    id="status" type="hidden" ></input>
			<table border="0" cellpadding="0" cellspacing="3" class="data-table">
			
				
								<!-- 表格的布局控制 -->
								<tr class="data-table-base-tr">
								<td  class="data-table-label" >
								</td>
								<td id="table_input_base" >
								</td>
								
								<td  class="data-table-right-margin"></td>
								</tr>
				<tr>
					<td  class="data-table-label">
					
					公众号appId：<font color="#FF0000">*</font>
					</td>
					 <td class="data-table-input">
					<input  style="width:100%;" type="text" class="easyui-validatebox textbox" data-options="required:true,novalidate:true"  name="appId"
					 id="appId"></input>
					</td>
				</tr>
				<tr>
					<td  class="data-table-label">
					
					公众号secret：<font color="#FF0000">*</font>
					</td>
					 <td class="data-table-input">
					<input  style="width:100%;" type="text" class="easyui-validatebox textbox" data-options="required:true,novalidate:true"  name="appSecret"
					 id="appSecret"></input>
					</td>
				</tr>
				<tr>
					<td  class="data-table-label">
					
					威富通secret：<font color="#FF0000">*</font>
					</td>
					 <td class="data-table-input">
					<input  style="width:100%;" type="text" name="paySecret" class="easyui-validatebox textbox" data-options="required:true,novalidate:true" 
					 id="paySecret"></input>
					</td>
				</tr>
				<tr>
					<td  class="data-table-label">
					
					威富通商户号：<font color="#FF0000">*</font>
					</td>
					 <td class="data-table-input">
					<input  style="width:100%;" type="text" name="mchId" class="easyui-validatebox textbox" data-options="required:true,novalidate:true" 
					 id="mchId"></input>
					</td>
				</tr>
				<tr>
				<td  class="data-table-label">
				支付类型：<font color="#FF0000">*</font>
				</td>
				 <td class="data-table-input" colspan=2 >
				<input class="easyui-combobox" id="status_combobox" 
						data-options="valueField:'id',textField:'text',editable:false," style="width:202px;"/>
				</td>
				</tr>
				<tr>
				<td  class="data-table-label">
				状态：<font color="#FF0000">*</font>
				</td>
				 <td class="data-table-input" colspan=2 >
				<input class="easyui-combobox" id="status_combobox_status" 
						data-options="valueField:'id',textField:'text',editable:false," style="width:202px;"/>
				</td>
				</tr>
             </table>


			</form>
			
			<!-- the dataForm end  -->
			
		</div>
	
	

	<script type="text/javascript">
		
		
		function initPage(){
			 
			
			 document.getElementById('id').value=parent.parent.mainFrame_id.selections[0].id;
			 parent.showProgressing();
			 sendRequestAjax('../../zcShopPayConfig/initUpdate.do?responseFunction=initUpdate&',initUpdate);
		}
		
		window.onload=function(){
			initPage();
		}
		
		var responseResultPage;
		function initUpdate(responseResult){
			
//			alert(iframeResponseText[0].entity.loginId);

			setFormDefault(responseResult); 
			responseResultPage=responseResult;
	
			$('#status_combobox').combobox({
			  		data: [{id:'wechat',text:'微信支付'},{id:'alipay',text:'支付宝'}],
			  		value:responseResult.entity.payType,
			  		width:parseInt($("#table_input_base")[0].offsetWidth)+2,
			  		onSelect: function(record){
				  			document.getElementById("payType").value=record.id;
					}
			});
			$('#status_combobox_status').combobox({
		  		data: [{id:'0',text:'失效'},{id:'1',text:'正常'}],
		  		value:responseResult.entity.status,
		  		width:parseInt($("#table_input_base")[0].offsetWidth)+2,
		  		onSelect: function(record){
			  			document.getElementById("status").value=record.id;
				}
			});
					
			parent.closeProgressing();
		}
		
		
	
		//form表单 提交 重置 提交后响应处理 ----------------
		
		
		
		
		function baseFormSubmit(){
			var flag= $("#baseForm").form('enableValidation').form('validate');
		    if(flag){
		  
		    	parent.showProgressing();
				sendRequestAjax('../../zcShopPayConfig/updateSave.do?responseFunction=updateSave',updateSave)
		    }
			
			
		}
		
		
		function  baseFormReset(){
			
			 initUpdate(responseResultPage);
			
		}
		
		function updateSave(responseResult){
			
			
			parent.parent.mainFrame_id.reloadPageData();
			
			if(responseResult.slide_msg_key==1){
				parent.parent.showSlideMsg(responseResult.slide_msg_message_key);
			}
			curWinClose();
			
		}
		//form表单 提交 重置 提交后响应处理结束 ------------
		//easyui日期控件  时间格式转化
		function myformatter(date){
			var y = date.getFullYear();
			var m = date.getMonth()+1;
			var d = date.getDate();

			var h = date.getHours();
			var mm = date.getMinutes();
			var s = date.getSeconds();
			return y+'-'+(m<10?('0'+m):m)+'-'+(d<10?('0'+d):d)+' '+(h<10?('0'+h):h)+':'+(mm<10?('0'+mm):mm) +':'+(s<10?('0'+s):s) ;
		}
		function myparser(s){
			if (!s) 
				return new Date();
			var dm = s.split(' ')
			var ss = (dm[0].split('-'));
			var y = parseInt(ss[0],10);
			var m = parseInt(ss[1],10);
			var d = parseInt(ss[2],10);
			
			var h, mm, s;
			
			if(dm[1] !=null && dm[1] !='' && dm[1] != undefined){
				var hms = (dm[1].split(':'));
				h =  parseInt(hms[0],10);
				mm =  parseInt(hms[1],10);
				s =  parseInt(hms[2],10);
			}
			
			if (!isNaN(y) && !isNaN(m) && !isNaN(d)){
				return new Date(y,m-1,d,h,mm ,s );
			}else{
				return new Date();
			}
		}
	</script>


	

</body>
</html>